<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<title>销售模块-销售产品</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="${s.base}/js/layui/css/layui.css" media="all" />
	<link rel="stylesheet" href="${s.base}/css/base/base.css" media="all" /></head>

<body class="childrenBody">
<form class="layui-form">
	<input type="hidden" id="id" name="id" value="${saleProduct.id}" />
	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;名称</label>
		<div class="layui-input-block">
			<input type="text" class="layui-input" name="name" value="${saleProduct.name}" placeholder="请输入名称" lay-verify="required" autocomplete="off" /></div>
	</div>
	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;试用期价格/元</label>
		<div class="layui-input-block">
			<input type="number" class="layui-input" name="price" value="${saleProduct.price}" placeholder="请输入试用期价格/元" lay-verify="required" autocomplete="off" /></div>
	</div>
	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;试用期天数</label>
		<div class="layui-input-block">
			<input type="text" class="layui-input" name="useDay" value="${saleProduct.useDay}" placeholder="请输入试用期天数" lay-verify="required" autocomplete="off" /></div>
	</div>
	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;一年价格/元</label>
		<div class="layui-input-block">
			<input type="number" class="layui-input" name="oneYearPrice" value="${saleProduct.oneYearPrice}" placeholder="请输入一年价格/元" lay-verify="required" autocomplete="off" /></div>
	</div>
	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;两年价格/元</label>
		<div class="layui-input-block">
			<input type="number" class="layui-input" name="twoYearPrice" value="${saleProduct.twoYearPrice}" placeholder="请输入两年价格/元" lay-verify="required" autocomplete="off" /></div>
	</div>
	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;三年价格/元</label>
		<div class="layui-input-block">
			<input type="number" class="layui-input" name="threeYearPrice" value="${saleProduct.threeYearPrice}" placeholder="请输入三年价格/元" lay-verify="required" autocomplete="off" /></div>
	</div>
	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;版本号</label>
		<div class="layui-input-block">
			<input type="text" class="layui-input" name="versionNum" value="${saleProduct.versionNum}" placeholder="请输入版本号" lay-verify="required" autocomplete="off" /></div>
	</div>
	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;项目地址</label>
		<div class="layui-input-block">
			<input type="text" class="layui-input" name="homeUrl" value="${saleProduct.homeUrl}" placeholder="请输入项目地址" lay-verify="required" autocomplete="off" /></div>
	</div>
	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;人员创建地址</label>
		<div class="layui-input-block">
			<input type="text" class="layui-input" name="userUrl" value="${saleProduct.userUrl}" placeholder="请输入人员创建地址" lay-verify="required" autocomplete="off" /></div>
	</div>
	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;所属分类</label>
		<div class="layui-input-block">
			<select class="form-control" name="colId" lay-verify="required" id="colId"></select>
		</div>
	</div>
	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red"></span>&nbsp;&nbsp;缩略图</label>
		<!--单图片开始-->
		<div class="layui-input-block cy-uploadpic-ctn" id="thumImage"  style=" float:left;margin:10px 0!important;position:relative; width: 90px; height: 90px;">
		</div>
		<!--单图片结束-->
	</div>
	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;内容详情</label>
		<div class="layui-input-block">
			<textarea class="layui-textarea" name="content" id="content"lay-verify="content" placeholder="请输入内容详情">${saleProduct.content}</textarea></div>
	</div>
	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;更新记录</label>
		<div class="layui-input-block">
			<textarea class="layui-textarea" name="versionRecord" id="versionRecord"lay-verify="versionRecord" placeholder="请输入更新记录">${saleProduct.versionRecord}</textarea></div>
	</div>

	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;排序号</label>
		<div class="layui-input-block">
			<input type="text" class="layui-input" name="sort" value="${saleProduct.sort}" placeholder="请输入排序号" lay-verify="required" autocomplete="off" /></div>
	</div>
	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;是否展示</label>
		<div class="layui-input-block">
			<select class="form-control" name="showType" lay-verify="required" id="showType"></select>
		</div>
	</div>
	<div class="layui-form-item layui-row layui-col-xs12">
		<div class="layui-input-block">
			<button class="layui-btn layui-btn-sm" lay-submit="" lay-filter="submitBtn">确定</button>
			<button type="reset" class="layui-btn layui-btn-sm layui-btn-primary cancel">取消</button></div>
	</div>
</form>
<script type="text/javascript" src="${s.base}/js/layui/layui.js"></script>
<script type="text/javascript" src="${s.base}/js/base/base.js"></script>
<script type="text/javascript" src="${s.base}/lib/KnifeZ/ace/ace.js"  charset="utf-8"></script>
<script type="text/javascript">layui.use(['form', 'jquery', 'baseUtil', 'pageUtil','fileUtil','richTxtUtil'],
    function() {
        var form = layui.form,
            $ = layui.jquery,
            fileUtil = layui.fileUtil,
            richTxtUtil = layui.richTxtUtil,
            baseUtil = layui.baseUtil,
            pageUtil = layui.pageUtil;
        //单图片上传
        fileUtil.uploadImageNoSave('thumImage',"sale/product","${saleProduct.thumImage}");

        //KnifeZ富文本
        var index=richTxtUtil.layeditKnifezBuild("content",300);
        var versionRecordIndex=richTxtUtil.layeditKnifezBuild("versionRecord",300);
        pageUtil.initDictByUrl("/saleColumn/acceptSelect","sale_column_type",function (dictDataUrl) {
            pageUtil.initDict("base_show_type",
                function(dictData) {
                    pageUtil.showDict($("#colId"), pageUtil.aceeptDictContentList(dictDataUrl, "sale_column_type"), "", '${saleProduct.colId}');
                    pageUtil.showDict($("#showType"), pageUtil.aceeptDictContentList(dictData, "base_show_type"), "", '${saleProduct.showType}');
                });
        });

        form.on('submit(submitBtn)',
            function(data) {
                data.field.content=richTxtUtil.layeditBuildContent(index);
                data.field.versionRecord=richTxtUtil.layeditBuildContent(versionRecordIndex);
                baseUtil.postMethodResult("/saleProduct/addOrUpdate", data.field,
                    function(result) {
                        parent.location.reload();
                    });
                return false;
            });
    });</script>
</body>

</html>